package com.bluesky.javawebbrowser.domain.html.tags.form;

import com.bluesky.javawebbrowser.domain.html.tags.Tag;
import com.bluesky.javawebbrowser.domain.html.tags.TagType;

public class Form extends Tag {
	private String name;
	private String action;
	private HttpMethod method;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
		getAttributes().put("name", name);
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
		getAttributes().put("action", action);
	}

	public HttpMethod getMethod() {
		return method;
	}

	public void setMethod(HttpMethod method) {
		this.method = method;
		getAttributes().put("method", method.toString());
	}

	public Form() {
		super(TagType.FORM);

		setAction("");
		setMethod(HttpMethod.Get);
	}

	public Form(Tag tag) {
		super(TagType.FORM);

		copy(tag);
	}
}
